unit uCfg;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, uFuncoes, Mask, rxToolEdit;

type
  TfrmCfg = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    edpath: TDirectoryEdit;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmCfg: TfrmCfg;

implementation

uses uDM;

{$R *.dfm}

procedure TfrmCfg.Button1Click(Sender: TObject);
var oldpath: string;
begin
   oldpath                := dmrel.ini1.IniFileName;
   dmrel.ini1.IniFileName := aqui('', 'cfgrel.ini');
   dmrel.ini1.IniSection  := 'CFG';
   dmRel.ini1.WriteString('path', edPath.Text);
   dmrel.ini1.IniFileName := oldpath;
   Close;
end;

procedure TfrmCfg.Button2Click(Sender: TObject);
begin
   Close;
end;

procedure TfrmCfg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Action := cafree;
   frmCfg := nil;
end;

procedure TfrmCfg.FormCreate(Sender: TObject);
begin
   edpath.Text := DMRel.aPath;
end;

end.
